<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>精选服务 - 社交服务平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #60a5fa;
            --primary-dark: #2563eb;
            --secondary: #8b5cf6;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #111827;
            --text-secondary: #6b7280;
            --text-light: #9ca3af;
            --bg-light: #f9fafb;
            --bg-white: #ffffff;
            --border-light: #e5e7eb;
            --border-medium: #d1d5db;
            --radius: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 55px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-actions {
            display: flex;
            gap: 15px;
            font-size: 1.2rem;
        }
        
        /* 搜索栏 */
        .search-bar {
            padding: 10px 15px;
            background-color: var(--bg-light);
        }
        
        .search-input-group {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 15px 10px 40px;
            border-radius: 20px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-white);
            font-size: 0.9rem;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-light);
        }
        
        /* 分类标签 */
        .category-tabs {
            display: flex;
            overflow-x: auto;
            padding: 10px 15px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            gap: 12px;
        }
        
        .category-tab {
            padding: 6px 14px;
            border-radius: 18px;
            font-size: 0.9rem;
            white-space: nowrap;
            background-color: var(--bg-light);
            color: var(--text-secondary);
        }
        
        .category-tab.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 服务列表 */
        .service-list {
            padding: 10px 15px;
        }
        
        .service-item {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            padding: 15px;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
        }
        
        .service-header {
            display: flex;
            margin-bottom: 10px;
        }
        
        .service-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            overflow: hidden;
            margin-right: 10px;
        }
        
        .service-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .service-provider {
            flex: 1;
        }
        
        .provider-name {
            font-weight: 500;
            margin-bottom: 2px;
        }
        
        .service-meta {
            display: flex;
            font-size: 0.8rem;
            color: var(--text-light);
            gap: 8px;
        }
        
        .service-content {
            margin-bottom: 10px;
        }
        
        .service-title {
            font-weight: 600;
            margin-bottom: 5px;
            line-height: 1.4;
        }
        
        .service-description {
            color: var(--text-secondary);
            font-size: 0.9rem;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        /* 图片容器 - 支持多图和无图 */
        .service-images {
            margin: 10px 0;
            display: none; /* 默认隐藏 */
        }
        
        .service-images.has-images {
            display: block;
        }
        
        .image-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
        }
        
        .service-image {
            aspect-ratio: 1/1;
            border-radius: 6px;
            overflow: hidden;
            position: relative;
        }
        
        .service-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .image-count {
            position: absolute;
            bottom: 5px;
            right: 5px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            font-size: 0.7rem;
            padding: 2px 6px;
            border-radius: 10px;
        }
        
        /* 服务标签和价格 */
        .service-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
        }
        
        .service-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        
        .service-tag {
            font-size: 0.8rem;
            padding: 2px 8px;
            border-radius: 4px;
            background-color: rgba(59, 130, 246, 0.1);
            color: var(--primary);
        }
        
        .service-price {
            font-weight: 600;
            color: var(--danger);
        }
        
        /* 服务操作栏 */
        .service-actions {
            display: flex;
            justify-content: space-between;
            padding: 8px 0 0;
            border-top: 1px solid var(--border-light);
            margin-top: 10px;
        }
        
        .action-button {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            background: none;
            border: none;
        }
        
        .action-button.primary {
            color: var(--primary);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
        }
        
        .nav-item i {
            font-size: 1.2rem;
            margin-bottom: 3px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 筛选悬浮按钮 */
        .filter-fab {
            position: fixed;
            right: 20px;
            bottom: 80px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
            z-index: 900;
        }
        
        /* 图片查看器 */
        .image-viewer {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: black;
            z-index: 3000;
            display: none;
            align-items: center;
            justify-content: center;
        }
        
        .image-viewer.show {
            display: flex;
        }
        
        .viewer-image {
            max-width: 100%;
            max-height: 100vh;
            object-fit: contain;
        }
        
        .viewer-close {
            position: absolute;
            top: 15px;
            right: 15px;
            color: white;
            font-size: 1.5rem;
            background: none;
            border: none;
        }
        
        .viewer-prev, .viewer-next {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            color: white;
            font-size: 2rem;
            background: none;
            border: none;
            padding: 20px 10px;
        }
        
        .viewer-prev {
            left: 0;
        }
        
        .viewer-next {
            right: 0;
        }
        
        .viewer-indicators {
            position: absolute;
            bottom: 20px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: center;
            gap: 8px;
        }
        
        .viewer-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.5);
        }
        
        .viewer-dot.active {
            background-color: white;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <div class="nav-left">
            <i class="fas fa-bars"></i>
        </div>
        <div class="nav-title">精选服务</div>
        <div class="nav-actions">
            <i class="far fa-bell"></i>
            <i class="far fa-user"></i>
        </div>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-bar">
        <div class="search-input-group">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索服务或服务提供者...">
        </div>
    </div>
    
    <!-- 分类标签 -->
    <div class="category-tabs">
        <div class="category-tab active">全部服务</div>
        <div class="category-tab">设计创意</div>
        <div class="category-tab">教育培训</div>
        <div class="category-tab">生活服务</div>
        <div class="category-tab">技术开发</div>
        <div class="category-tab">营销推广</div>
        <div class="category-tab">咨询服务</div>
    </div>
    
    <!-- 服务列表 -->
    <div class="service-list">
        <!-- 服务项1 - 多图服务 -->
        <div class="service-item">
            <div class="service-header">
                <div class="service-avatar">
                    <img src="https://picsum.photos/id/64/100/100" alt="服务提供者头像">
                </div>
                <div class="service-provider">
                    <div class="provider-name">创意摄影工作室</div>
                    <div class="service-meta">
                        <span><i class="fas fa-map-marker-alt"></i> 北京市</span>
                        <span><i class="fas fa-star"></i> 4.9</span>
                    </div>
                </div>
            </div>
            
            <div class="service-content">
                <div class="service-title">专业人像摄影服务 含精修 支持上门拍摄</div>
                <div class="service-description">
                    提供专业人像摄影服务，包括个人写真、情侣照、家庭照等。包含10张精修照片，提供服装造型建议，可预约上门拍摄服务。
                </div>
            </div>
            
            <!-- 多图展示 -->
            <div class="service-images has-images">
                <div class="image-grid" data-service-id="1">
                    <div class="service-image">
                        <img src="https://picsum.photos/id/26/300/300" alt="服务图片1">
                    </div>
                    <div class="service-image">
                        <img src="https://picsum.photos/id/28/300/300" alt="服务图片2">
                    </div>
                    <div class="service-image">
                        <img src="https://picsum.photos/id/29/300/300" alt="服务图片3">
                        <div class="image-count">+5</div>
                    </div>
                </div>
            </div>
            
            <div class="service-footer">
                <div class="service-tags">
                    <div class="service-tag">摄影</div>
                    <div class="service-tag">上门服务</div>
                    <div class="service-tag">人像</div>
                </div>
                <div class="service-price">¥399起</div>
            </div>
            
            <div class="service-actions">
                <button class="action-button">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </button>
                <button class="action-button">
                    <i class="far fa-heart"></i>
                    <span>收藏</span>
                </button>
                <button class="action-button primary">
                    <i class="fas fa-shopping-cart"></i>
                    <span>预约</span>
                </button>
            </div>
        </div>
        
        <!-- 服务项2 - 无图服务 -->
        <div class="service-item">
            <div class="service-header">
                <div class="service-avatar">
                    <img src="https://picsum.photos/id/65/100/100" alt="服务提供者头像">
                </div>
                <div class="service-provider">
                    <div class="provider-name">李明法律咨询</div>
                    <div class="service-meta">
                        <span><i class="fas fa-map-marker-alt"></i> 上海市</span>
                        <span><i class="fas fa-star"></i> 4.8</span>
                    </div>
                </div>
            </div>
            
            <div class="service-content">
                <div class="service-title">婚姻家庭法律咨询 在线解答 专业指导</div>
                <div class="service-description">
                    资深律师提供婚姻家庭法律咨询服务，包括离婚财产分割、子女抚养权、婚前协议等问题的专业解答和指导，支持在线咨询。
                </div>
            </div>
            
            <!-- 无图服务，不显示图片容器 -->
            <div class="service-images">
                <div class="image-grid"></div>
            </div>
            
            <div class="service-footer">
                <div class="service-tags">
                    <div class="service-tag">法律咨询</div>
                    <div class="service-tag">婚姻家庭</div>
                    <div class="service-tag">在线服务</div>
                </div>
                <div class="service-price">¥199/小时</div>
            </div>
            
            <div class="service-actions">
                <button class="action-button">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </button>
                <button class="action-button">
                    <i class="far fa-heart"></i>
                    <span>收藏</span>
                </button>
                <button class="action-button primary">
                    <i class="fas fa-shopping-cart"></i>
                    <span>购买</span>
                </button>
            </div>
        </div>
        
        <!-- 服务项3 - 单图服务 -->
        <div class="service-item">
            <div class="service-header">
                <div class="service-avatar">
                    <img src="https://picsum.photos/id/66/100/100" alt="服务提供者头像">
                </div>
                <div class="service-provider">
                    <div class="provider-name">编程学习工作室</div>
                    <div class="service-meta">
                        <span><i class="fas fa-map-marker-alt"></i> 广州市</span>
                        <span><i class="fas fa-star"></i> 4.7</span>
                    </div>
                </div>
            </div>
            
            <div class="service-content">
                <div class="service-title">Python编程入门教学 一对一在线辅导</div>
                <div class="service-description">
                    针对零基础学员的Python编程入门教学，一对一在线辅导，根据学员进度定制学习计划，提供练习项目和答疑服务。
                </div>
            </div>
            
            <!-- 单图展示 -->
            <div class="service-images has-images">
                <div class="image-grid" data-service-id="3">
                    <div class="service-image">
                        <img src="https://picsum.photos/id/0/300/300" alt="服务图片1">
                    </div>
                </div>
            </div>
            
            <div class="service-footer">
                <div class="service-tags">
                    <div class="service-tag">编程教学</div>
                    <div class="service-tag">Python</div>
                    <div class="service-tag">在线辅导</div>
                </div>
                <div class="service-price">¥89/课时</div>
            </div>
            
            <div class="service-actions">
                <button class="action-button">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </button>
                <button class="action-button">
                    <i class="far fa-heart"></i>
                    <span>收藏</span>
                </button>
                <button class="action-button primary">
                    <i class="fas fa-shopping-cart"></i>
                    <span>购买</span>
                </button>
            </div>
        </div>
        
        <!-- 服务项4 - 两图服务 -->
        <div class="service-item">
            <div class="service-header">
                <div class="service-avatar">
                    <img src="https://picsum.photos/id/67/100/100" alt="服务提供者头像">
                </div>
                <div class="service-provider">
                    <div class="provider-name">花艺设计工作室</div>
                    <div class="service-meta">
                        <span><i class="fas fa-map-marker-alt"></i> 深圳市</span>
                        <span><i class="fas fa-star"></i> 4.9</span>
                    </div>
                </div>
            </div>
            
            <div class="service-content">
                <div class="service-title">定制鲜花束 生日/节日/纪念日花艺设计 同城配送</div>
                <div class="service-description">
                    专业花艺师定制各类鲜花束，适用于生日、节日、纪念日等场合，提供个性化设计，支持同城3小时内送达服务。
                </div>
            </div>
            
            <!-- 两图展示 -->
            <div class="service-images has-images">
                <div class="image-grid" data-service-id="4">
                    <div class="service-image">
                        <img src="https://picsum.photos/id/152/300/300" alt="服务图片1">
                    </div>
                    <div class="service-image">
                        <img src="https://picsum.photos/id/153/300/300" alt="服务图片2">
                    </div>
                </div>
            </div>
            
            <div class="service-footer">
                <div class="service-tags">
                    <div class="service-tag">花艺</div>
                    <div class="service-tag">定制</div>
                    <div class="service-tag">同城配送</div>
                </div>
                <div class="service-price">¥168起</div>
            </div>
            
            <div class="service-actions">
                <button class="action-button">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </button>
                <button class="action-button">
                    <i class="far fa-heart"></i>
                    <span>收藏</span>
                </button>
                <button class="action-button primary">
                    <i class="fas fa-shopping-cart"></i>
                    <span>预订</span>
                </button>
            </div>
        </div>
        
        <!-- 服务项5 - 无图服务 -->
        <div class="service-item">
            <div class="service-header">
                <div class="service-avatar">
                    <img src="https://picsum.photos/id/68/100/100" alt="服务提供者头像">
                </div>
                <div class="service-provider">
                    <div class="provider-name">财务咨询顾问</div>
                    <div class="service-meta">
                        <span><i class="fas fa-map-marker-alt"></i> 杭州市</span>
                        <span><i class="fas fa-star"></i> 4.6</span>
                    </div>
                </div>
            </div>
            
            <div class="service-content">
                <div class="service-title">个人理财规划 投资咨询 财务分析服务</div>
                <div class="service-description">
                    专业财务顾问提供个人理财规划服务，包括投资组合建议、资产配置分析、财务目标设定等，帮助您实现财富增长。
                </div>
            </div>
            
            <!-- 无图服务 -->
            <div class="service-images">
                <div class="image-grid"></div>
            </div>
            
            <div class="service-footer">
                <div class="service-tags">
                    <div class="service-tag">财务咨询</div>
                    <div class="service-tag">理财规划</div>
                    <div class="service-tag">投资建议</div>
                </div>
                <div class="service-price">¥299/次</div>
            </div>
            
            <div class="service-actions">
                <button class="action-button">
                    <i class="far fa-comment"></i>
                    <span>咨询</span>
                </button>
                <button class="action-button">
                    <i class="far fa-heart"></i>
                    <span>收藏</span>
                </button>
                <button class="action-button primary">
                    <i class="fas fa-shopping-cart"></i>
                    <span>购买</span>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 筛选悬浮按钮 -->
    <div class="filter-fab">
        <i class="fas fa-filter"></i>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <div class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </div>
        <div class="nav-item active">
            <i class="fas fa-concierge-bell"></i>
            <span>服务</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-plus-circle"></i>
            <span>发布</span>
        </div>
        <div class="nav-item">
            <i class="far fa-comment"></i>
            <span>消息</span>
        </div>
        <div class="nav-item">
            <i class="far fa-user"></i>
            <span>我的</span>
        </div>
    </div>
    
    <!-- 图片查看器 -->
    <div class="image-viewer" id="imageViewer">
        <button class="viewer-close" id="viewerClose">
            <i class="fas fa-times"></i>
        </button>
        <button class="viewer-prev" id="viewerPrev">
            <i class="fas fa-chevron-left"></i>
        </button>
        <img src="" alt="大图预览" class="viewer-image" id="viewerImage">
        <button class="viewer-next" id="viewerNext">
            <i class="fas fa-chevron-right"></i>
        </button>
        <div class="viewer-indicators" id="viewerIndicators">
            <!-- 动态生成指示器 -->
        </div>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 模拟服务图片数据
        const serviceImages = {
            1: [
                'https://picsum.photos/id/26/800/800',
                'https://picsum.photos/id/28/800/800',
                'https://picsum.photos/id/29/800/800',
                'https://picsum.photos/id/30/800/800',
                'https://picsum.photos/id/31/800/800',
                'https://picsum.photos/id/32/800/800',
                'https://picsum.photos/id/33/800/800'
            ],
            3: [
                'https://picsum.photos/id/0/800/800'
            ],
            4: [
                'https://picsum.photos/id/152/800/800',
                'https://picsum.photos/id/153/800/800'
            ]
        };
        
        // 图片查看器功能
        const imageViewer = document.getElementById('imageViewer');
        const viewerImage = document.getElementById('viewerImage');
        const viewerClose = document.getElementById('viewerClose');
        const viewerPrev = document.getElementById('viewerPrev');
        const viewerNext = document.getElementById('viewerNext');
        const viewerIndicators = document.getElementById('viewerIndicators');
        
        let currentServiceId = null;
        let currentImageIndex = 0;
        let currentImages = [];
        
        // 打开图片查看器
        function openImageViewer(serviceId, index) {
            currentServiceId = serviceId;
            currentImages = serviceImages[serviceId] || [];
            
            if (currentImages.length === 0) return;
            
            currentImageIndex = index;
            updateViewerImage();
            createViewerIndicators();
            
            imageViewer.classList.add('show');
            document.body.style.overflow = 'hidden';
        }
        
        // 关闭图片查看器
        function closeImageViewer() {
            imageViewer.classList.remove('show');
            document.body.style.overflow = '';
        }
        
        // 更新查看器图片
        function updateViewerImage() {
            viewerImage.src = currentImages[currentImageIndex];
            updateViewerIndicators();
        }
        
        // 创建查看器指示器
        function createViewerIndicators() {
            viewerIndicators.innerHTML = '';
            
            currentImages.forEach((_, index) => {
                const dot = document.createElement('div');
                dot.className = `viewer-dot ${index === currentImageIndex ? 'active' : ''}`;
                dot.addEventListener('click', () => {
                    currentImageIndex = index;
                    updateViewerImage();
                });
                viewerIndicators.appendChild(dot);
            });
        }
        
        // 更新指示器状态
        function updateViewerIndicators() {
            const dots = viewerIndicators.querySelectorAll('.viewer-dot');
            dots.forEach((dot, index) => {
                dot.classList.toggle('active', index === currentImageIndex);
            });
        }
        
        // 上一张图片
        function prevImage() {
            currentImageIndex = (currentImageIndex - 1 + currentImages.length) % currentImages.length;
            updateViewerImage();
        }
        
        // 下一张图片
        function nextImage() {
            currentImageIndex = (currentImageIndex + 1) % currentImages.length;
            updateViewerImage();
        }
        
        // 绑定图片点击事件
        document.querySelectorAll('.service-image img').forEach((img, index) => {
            img.addEventListener('click', () => {
                const grid = img.closest('.image-grid');
                const serviceId = grid.getAttribute('data-service-id');
                openImageViewer(serviceId, index);
            });
        });
        
        // 绑定查看器事件
        viewerClose.addEventListener('click', closeImageViewer);
        viewerPrev.addEventListener('click', prevImage);
        viewerNext.addEventListener('click', nextImage);
        
        // 点击查看器外部关闭
        imageViewer.addEventListener('click', (e) => {
            if (e.target === imageViewer) {
                closeImageViewer();
            }
        });
        
        // 分类标签切换
        const categoryTabs = document.querySelectorAll('.category-tab');
        categoryTabs.forEach(tab => {
            tab.addEventListener('click', () => {
                categoryTabs.forEach(t => t.classList.remove('active'));
                tab.classList.add('active');
                // 实际项目中这里会根据选择的分类加载对应服务列表
            });
        });
        
        // 服务操作按钮交互
        const actionButtons = document.querySelectorAll('.action-button');
        actionButtons.forEach(btn => {
            if (btn.querySelector('.fa-heart')) {
                btn.addEventListener('click', () => {
                    const icon = btn.querySelector('i');
                    icon.classList.toggle('far');
                    icon.classList.toggle('fas');
                    icon.classList.toggle('text-danger');
                });
            }
        });
        
        // 模拟加载更多功能
        let page = 1;
        const loadMoreServices = () => {
            // 实际项目中这里会通过AJAX加载更多服务
            console.log(`加载第${page + 1}页服务`);
            page++;
        };
        
        // 滚动加载更多
        window.addEventListener('scroll', () => {
            if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 300) {
                loadMoreServices();
            }
        });
    </script>
</body>
</html>


